package edu.sctu.zhengsenwen.month201506.day20150615.files;

import java.io.File;

/**
 * Created by user15 on 2015/6/14.
 */
public class CreateDirectoryDemo {

    public CreateDirectoryDemo() {

        File file = new File("C:\\C19");

        boolean result = false;


        if (!file.exists()) {

            result = file.mkdir();

            if (result) {

                System.out.println("C19文件及创建成功");
            }
        } else {
            System.out.println("C19文件夹已存在");
        }

        file = new File("C:\\C20\\ZSW");

        if (!file.exists()) {

            result = file.mkdir();

            if (!result) {

                System.out.println("C20目录不存在，无法创建ZSW文件夹");
            }
        } else {
            System.out.println("C:\\C20\\ZSW已存在");
        }

        if (!file.exists()) {

            result = file.mkdirs();

            if (result) {

                System.out.println("目录C:\\C20\\ZSW创建成功");
            }
        }
    }

    public static void main(String[] args) {

        new CreateDirectoryDemo();
    }
}
